const http = require('http')
const EventEmitter = require('events')

class MyEmitter extends EventEmitter {}

const myEmitter = new MyEmitter()
// 用箭头函数时，this 不等于 myEmitter
myEmitter.on('event', function (a, b)  {
    console.log(a, b, this, this === myEmitter)
})

http.createServer((req, res) => {
    console.log('hhhh')
}).listen(3000, '127.0.0.1')
let a = 'hh', b = 'hehe'
myEmitter.emit('event', a, b)
